package com.ithema.exception;

public class SystemException extends RuntimeException {//继承运行时异常，出现了可以不处理，可以往上层继续抛

    //定义异常编号
    private Integer code;

    //然后生成父类构造方法，这里构造方法按业务所需

    public SystemException(Integer code,String message) {
        super(message);
        this.code = code;
    }

    public SystemException(Integer code,String message, Throwable cause) {
        super(message, cause);
        this.code = code;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    @Override
    public String getMessage() {
        return super.getMessage();
    }

    /*             先不用的进行注释
    public SystemException(Integer Integer) {
        this.Integer = Integer;
    }

     public SystemException(Throwable cause, Integer Integer) {
        super(cause);
        this.Integer = Integer;
    }

    public SystemException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace, Integer Integer) {
        super(message, cause, enableSuppression, writableStackTrace);
        this.Integer = Integer;
    }

    */
}
